UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ui75dSVIm08cTpMf8TqTp2Z4mdGZGj3PFN9VGSNlp0g='
WHERE
key_id = '89fc3ff9c50b0ca622b5d9985b7d308a5faaca4cfbcd3cda8a9df877078c4976'
AND (
token = 'ui75dSVIm08cTpMf8TqTp2Z4mdGZGj3PFN9VGSNlp0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)