UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IRZLcwxygzkVIrLf63ahqdn9ZXaNPW4bkvZXT+tRG2M='
WHERE
key_id = '9077d89d1158d6e943d1a194f3ede6e163575db60748c667b49a11b040ae0ea6'
AND (
token = 'IRZLcwxygzkVIrLf63ahqdn9ZXaNPW4bkvZXT+tRG2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)