UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EppbHE0EXfWlLJORTM31yMv1BiT/feBDm9uLuARVUJ8=' 
WHERE 
  key_id = '610f498e4517c268d5d33cc8415bc47b2fd3ebd3f6e1ff9143dd0eefcfd3c909' 
  AND (
    token = 'EppbHE0EXfWlLJORTM31yMv1BiT/feBDm9uLuARVUJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035