UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OrToD+2Ea3cqNvnzLjy5HgYGahh3n7s+5asdSqJhgO8=' 
WHERE 
  key_id = '5e1db1320603a5bb85445c5ae9f40e42f513c7acd47b2fdf2ee4e136bdd94fcc' 
  AND (
    token = 'OrToD+2Ea3cqNvnzLjy5HgYGahh3n7s+5asdSqJhgO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049