UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g6HmRR33ptjBd7p6ibemOHeKfV1qQwbG7+rDLANZWZc='
WHERE
key_id = 'fd936e4f59f5d056eb91f8b5b07c4a209a18537b72df7d70575157fe2469f2b6'
AND (
token = 'g6HmRR33ptjBd7p6ibemOHeKfV1qQwbG7+rDLANZWZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)