UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rtEThRzlJR0FzwKLOo3jCxSK7PeKbc2cPgSskBejq0E='
WHERE
key_id = '90b26ffdb37bfee1d5caeef970280e9292580ed35007bc14ad11cbe30d1aa849'
AND (
token = 'rtEThRzlJR0FzwKLOo3jCxSK7PeKbc2cPgSskBejq0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)