UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iI7STZaChitQtBbSFOxVb0PfrELD+/PS2P1cRZcpY/g=' 
WHERE 
  key_id = 'c4f0fda57b470f18be35b49f8c3defd60778e5f809f12c0bbcc4eeac1acc98b9' 
  AND (
    token = 'iI7STZaChitQtBbSFOxVb0PfrELD+/PS2P1cRZcpY/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029