UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b5S7A/IbnPJrKUDsAwQhklF+kxVGOTaHdPdQj1AKaLg='
WHERE
key_id = '43d824b931427a7c399ecfa3f2951a94e10486a4add2fc4208dcb8a93f240fd2'
AND (
token = 'b5S7A/IbnPJrKUDsAwQhklF+kxVGOTaHdPdQj1AKaLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)