UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PSoF2ixBDW+GxQ3jN2ZNGRuwrzCcVAC2Oun2xs7ue8I='
WHERE
key_id = '4fb9e54f60e211aa9ac84618682d0039dede8cf0440978552b9b41b861e1b26f'
AND (
token = 'PSoF2ixBDW+GxQ3jN2ZNGRuwrzCcVAC2Oun2xs7ue8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)