UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4O/bSmCJBIEB3FWgb0ZUcLgps9bleNKmAIL7xqQdBhw='
WHERE
key_id = '139f77dcf71cf5d37313b128587fdf56aa8f68295f7902ab0bbd1090c45dae78'
AND (
token = '4O/bSmCJBIEB3FWgb0ZUcLgps9bleNKmAIL7xqQdBhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)