UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'crYbWc2+pLvnZU9QB8nRZ3UdXTwj3xhc1bsF8fbEunU=' 
WHERE 
  key_id = '57f3d3ac9bba6f71c793d4d872097f691ed8761b6431f9c9963bc97a01a279ba' 
  AND (
    token = 'crYbWc2+pLvnZU9QB8nRZ3UdXTwj3xhc1bsF8fbEunU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018