UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dXGvnFdWvwYUZLVejivWYNrU58EB3/Wep4dVvwSNSNk=' 
WHERE 
  key_id = '085101556e8dd8062de6e9bf222bbda2c06e8d5be8ba9b50fc1968f3f8eb233d' 
  AND (
    token = 'dXGvnFdWvwYUZLVejivWYNrU58EB3/Wep4dVvwSNSNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034