UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V0Swn12bULMLvU//UbEb1uxLlM1b0vfLx1MWwug5QkQ=' 
WHERE 
  key_id = '9a4ff7c0c3c88d494099e3750deae4a507560de675ad7e3caa41f5927c401a91' 
  AND (
    token = 'V0Swn12bULMLvU//UbEb1uxLlM1b0vfLx1MWwug5QkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041