UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/eDv/58TJpqkpJAoLzPpkrVO924ClNplIY4dhTxW7bg='
WHERE
key_id = 'b4b098597e3170fead4a513e1cfc44360ec2dfc4f762ba1230b1c7f7b8ba0f24'
AND (
token = '/eDv/58TJpqkpJAoLzPpkrVO924ClNplIY4dhTxW7bg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)