UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LQ6AdUEPt6/M/eLmniCrsSH3g13V2+DShfusTZOkcDw='
WHERE
key_id = '62592f4ceb252cdc4868b3daf3b5c57f001588a71a9031266177f3d519f7c5a8'
AND (
token = 'LQ6AdUEPt6/M/eLmniCrsSH3g13V2+DShfusTZOkcDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)