UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W2JNPv7ULz2EtW/feS+7Q7ZAljz0aVHF0IecdLdrV/g='
WHERE
key_id = '2da615ca75b3bf5b98956a53fe1326fac6038fdb0bf9fd1abdb2d0ea8016a5ec'
AND (
token = 'W2JNPv7ULz2EtW/feS+7Q7ZAljz0aVHF0IecdLdrV/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)