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

Query time 0.00039