UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MtB832W6Jkypwng+WUKIHjR2aAP13WV5PWeIQSIZ0cU='
WHERE
key_id = '636f810c267bbe1cd7e3473765fdc0b4cf13da6c04029a3b0a18da41535ab024'
AND (
token = 'MtB832W6Jkypwng+WUKIHjR2aAP13WV5PWeIQSIZ0cU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)