UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3CyX7J9OgnP7xGXG3kkKD8IQmr9OTTJR25qz4AG+UFI='
WHERE
key_id = '715a4d40f13f7bc721019dfe0911da182e7020dba9b4298647ee79f265530e36'
AND (
token = '3CyX7J9OgnP7xGXG3kkKD8IQmr9OTTJR25qz4AG+UFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)