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