UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VCLWgjAA42VqD0swTR8g7GYSjY8Kh5kpvkdWg8TC7Sg='
WHERE
key_id = '783c5161a0cdbdcc3ca43a2bc3c4fb8b111fe5ef04a46fa15becf056377f8e97'
AND (
token = 'VCLWgjAA42VqD0swTR8g7GYSjY8Kh5kpvkdWg8TC7Sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)