UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't9WpJp2apnugaMurP7StYHmoQHB6pi05dSJWqmSiY7k=' 
WHERE 
  key_id = '66434178cdd0f1a5b34bc69ca9ae1afcd22f4cc6392bb1c0a61f688f0b5558f2' 
  AND (
    token = 't9WpJp2apnugaMurP7StYHmoQHB6pi05dSJWqmSiY7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051