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

Query time 0.00027