UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ss5em15GlC08bcF2ahEAn/ESh3R+w5h1Jh/w2A3yFQ=' 
WHERE 
  key_id = 'fdfd2bfd557eacb8c497e67cefcd0f198addeb3f1b4b87fb6c2078bc2bf4e458' 
  AND (
    token = '0ss5em15GlC08bcF2ahEAn/ESh3R+w5h1Jh/w2A3yFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030