UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gQA/JvC1UhdWQMi0OVtXhKsO7c5/yDSwb9UBFpTAiTA='
WHERE
key_id = '55e9a2bb940c0b18f57b77082cf0e0136aba3e391e7e633afca39b8569779ba0'
AND (
token = 'gQA/JvC1UhdWQMi0OVtXhKsO7c5/yDSwb9UBFpTAiTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)