UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XYtR5Yk9LrXso7C1nBMZdT4xDGPuXRn5x7P41dpVWNU='
WHERE
key_id = 'bf85ccc0b26734e34368178fb9f52403c9377a1e31ea90c017fbdba9486e0c5f'
AND (
token = 'XYtR5Yk9LrXso7C1nBMZdT4xDGPuXRn5x7P41dpVWNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)