UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't4UbpUFaJSpzxEG8CqylG8NeaXBSFAcJPMvuYELv/VA='
WHERE
key_id = 'edc95c9ed85666cc6d727185d0e15b7df1212ad1dec43f0df996257b94ae5b47'
AND (
token = 't4UbpUFaJSpzxEG8CqylG8NeaXBSFAcJPMvuYELv/VA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)