UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UehKWuaJHObV6y1JukaQSX5aLdV8f+O8C28iZ7j3wL4='
WHERE
key_id = '6aa5f892950ab268173fde9e342f5b3712b0733f7394d6feced404f2e5aacb0c'
AND (
token = 'UehKWuaJHObV6y1JukaQSX5aLdV8f+O8C28iZ7j3wL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)