UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rFR3q6dt9UZ4Ttwgzy+LLG+7Jqqq3Bawwn2vD5UluRA='
WHERE
key_id = 'b62ad855e9f53a6f2c4baadd101f218273e1efeb1e69ba3748cac3552f8e5ee1'
AND (
token = 'rFR3q6dt9UZ4Ttwgzy+LLG+7Jqqq3Bawwn2vD5UluRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)