UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fUKUEh1E5RAdxH1nBGD1s5yGquHD6l0hlsWyHvt5qsI='
WHERE
key_id = 'ee5722debcd53a720cf792cf5ae047f93ee5d6deaa493e7d96dfa494a28f1194'
AND (
token = 'fUKUEh1E5RAdxH1nBGD1s5yGquHD6l0hlsWyHvt5qsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)