UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L3FKRtBcGfMn3RdRz0pihkaZs1yNlQPuSt5p0AjEWRw=' 
WHERE 
  key_id = '5feb9bea484556eb735d78aeb5700d7dad21bc436a04c0ca3da8e84e0ee4f98e' 
  AND (
    token = 'L3FKRtBcGfMn3RdRz0pihkaZs1yNlQPuSt5p0AjEWRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059