UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JvwNlGIBneqOPa+qebc+47eHR7Y8/9yWWyNIYHzrMwc=' 
WHERE 
  key_id = 'c1010dbf9ca4973ffaffe4cae0915b9ee80326c46dad65b51ac556a0665bff41' 
  AND (
    token = 'JvwNlGIBneqOPa+qebc+47eHR7Y8/9yWWyNIYHzrMwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021