UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'munzCUameb9CODH5OWtChLPNgDvL4f3IfNfEYW2eetY=' 
WHERE 
  key_id = '67b6fc8f1a12796f2f830f13919b81a47e90e50e1551b5735eafc6f6ed79459c' 
  AND (
    token = 'munzCUameb9CODH5OWtChLPNgDvL4f3IfNfEYW2eetY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040