UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UpVtvwh0Fx64UTOqOX05QyEZU9XlpA9IXeiG9kYooQU=' 
WHERE 
  key_id = '6a35691d9e573225df68f0f551ad394299da99c9af5e501c86dfbe065e1acfa6' 
  AND (
    token = 'UpVtvwh0Fx64UTOqOX05QyEZU9XlpA9IXeiG9kYooQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017