UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm82aL0z3eoxG3EnLB/9aYgaHQSEyr0jo6zrlH6rT4wo=' 
WHERE 
  key_id = '15e950aeb08bb3a0e3a2bce0b750d65acd96138f6297cf194d4e5b81a0259bd8' 
  AND (
    token = 'm82aL0z3eoxG3EnLB/9aYgaHQSEyr0jo6zrlH6rT4wo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046