UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IiTs1Vp6zGz3IPSKsDcQlNHZxzP4HzCFJ3QD8q7/rmQ=' 
WHERE 
  key_id = 'ff615ee807106b72b169107153121f7754d109acffdbdbcbdff0d9fa10009a04' 
  AND (
    token = 'IiTs1Vp6zGz3IPSKsDcQlNHZxzP4HzCFJ3QD8q7/rmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054