UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'smYr+lv6Sdeaxmo1o35xNH3b9CVYKRaQBZvTa3K/GKI=' 
WHERE 
  key_id = '4ed63cc81fa653a9f81be9deb13b04b50cb22ecc317c7c3d69a0d48121b9e1ee' 
  AND (
    token = 'smYr+lv6Sdeaxmo1o35xNH3b9CVYKRaQBZvTa3K/GKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040