UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bT+N8rJprWbgYNBQGZiq558NoOeUh0EA1ZM0C3nV2lY=' 
WHERE 
  key_id = 'f85d2d7db45a5555cfab815e52ef3087fc05ae31c4256032f926c2d95b69f79f' 
  AND (
    token = 'bT+N8rJprWbgYNBQGZiq558NoOeUh0EA1ZM0C3nV2lY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066