UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f3aOmN6DFdxiq9bJddp3I0IuJnojnBWsyA5nVupOdN8=' 
WHERE 
  key_id = 'ba3bbd4de85964017de1357f7e7f6bbc0f4c4f37257028b134f06e42af7d0431' 
  AND (
    token = 'f3aOmN6DFdxiq9bJddp3I0IuJnojnBWsyA5nVupOdN8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041